package cn.cheln.explorer.ds.scan;

import cn.cheln.support.highlight.Unicode2Alpha;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;

public class PinyinHelper
{
  static HanyuPinyinOutputFormat hanyuPinyinOutputFormat = new HanyuPinyinOutputFormat();

  static
  {
    HanyuPinyinOutputFormat localHanyuPinyinOutputFormat1 = hanyuPinyinOutputFormat;
    hanyuPinyinOutputFormat.getCaseType();
    localHanyuPinyinOutputFormat1.setCaseType(HanyuPinyinCaseType.LOWERCASE);
    HanyuPinyinOutputFormat localHanyuPinyinOutputFormat2 = hanyuPinyinOutputFormat;
    hanyuPinyinOutputFormat.getVCharType();
    localHanyuPinyinOutputFormat2.setVCharType(HanyuPinyinVCharType.WITH_V);
    HanyuPinyinOutputFormat localHanyuPinyinOutputFormat3 = hanyuPinyinOutputFormat;
    hanyuPinyinOutputFormat.getToneType();
    localHanyuPinyinOutputFormat3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
  }

  public static String rawTransfer(String paramString)
  {
    try
    {
      String str = net.sourceforge.pinyin4j.PinyinHelper.toHanyuPinyinString(paramString, hanyuPinyinOutputFormat, "");
      return str;
    }
    catch (BadHanyuPinyinOutputFormatCombination localBadHanyuPinyinOutputFormatCombination)
    {
      localBadHanyuPinyinOutputFormatCombination.printStackTrace();
    }
    return "";
  }

  public static String transfer(String paramString)
  {
    int i = 1;
    String str1 = "";
    int j = 0;
    while (true)
    {
      if (j >= paramString.length())
      {
        if (!(Unicode2Alpha.toAlpha(paramString).equals(str1)))
          str1 = str1 + "|" + Unicode2Alpha.toAlpha(paramString);
        return str1;
      }
      String str2 = new Character(paramString.charAt(j)).toString();
      Object localObject = "";
      try
      {
        String str3 = net.sourceforge.pinyin4j.PinyinHelper.toHanyuPinyinString(str2, hanyuPinyinOutputFormat, "");
        localObject = str3;
        if (!(str2.equals(localObject)))
        {
          label92: localObject = "*" + ((String)localObject) + "*" + str2;
          if (i != 0)
            localObject = ((String)localObject).substring(1, 2) + ((String)localObject);
        }
        str1 = str1 + ((String)localObject);
        ++j;
        i = 0;
      }
      catch (BadHanyuPinyinOutputFormatCombination localBadHanyuPinyinOutputFormatCombination)
      {
        localBadHanyuPinyinOutputFormatCombination.printStackTrace();
        break label92:
      }
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.ds.scan.PinyinHelper
 * JD-Core Version:    0.5.2
 */